package cn.tedu.storage.mapper;

import cn.tedu.storage.entity.Storage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

public interface StorageMapper extends BaseMapper<Storage> {
    void decrease(Long productId,Integer count);

    //查询库存,用来判断是否有足够库存
    Storage selectByProductId(Long productId);
    //可用Residue --> 冻结Frozen
    void updateResidueToFrozen(Long productId,Integer count);
    //冻结Frozen --> 已使用Used
    void updateFrozenToUsed(Long productId,Integer count);
    //冻结Frozen --> 可用Residue
    void updateFrozenToResidue(Long productId,Integer count);
}
